FROM 192.168.11.18:5000/ubuntu_sshd
MAINTAINER Chris Song songchuansheng@91waijiao.com
 
# Update apt sources list to fetch mongodb and a few key packages
ADD files/sources.list /etc/apt/sources.list

RUN apt-get update
#RUN apt-get install openssh-server
#RUN apt-get upgrade -y

# And we want our SSH key to be added
RUN mkdir /root/.ssh && chmod 700 /root/.ssh
ADD files/ansible_id_rsa.pub /root/.ssh/authorized_keys
RUN chmod 400 /root/.ssh/authorized_keys && chown root:root /root/.ssh/authorized_keys

# Add monit service
RUN apt-get install -y monit
ADD files/monitrc /etc/monit/monitrc
RUN chmod 400 /etc/monit/monitrc && chown root:root /etc/monit/monitrc

# set timezone
RUN echo "Asia/Shanghai" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata

# set locale
ADD files/locale /etc/default/locale
RUN dpkg-reconfigure -f noninteractive locales

# add startup scripts
ADD docker_start.sh /docker_start.sh

# Expose a bunch of ports .. 22 for SSH
EXPOSE 22

#ENTRYPOINT ["/usr/sbin/sshd", "-D"]
CMD "/docker_start.sh"

